﻿using System;
using fastCSharp;

namespace diantou.web.user
{
    /// <summary>
    /// 用户的收藏动态
    /// </summary>
    [fastCSharp.code.cSharp.webView(IsPool = true, IsReferer = false)]
    partial class newFavorite : view<newFavorite>
    {
        /// <summary>
        /// 收藏动态集合
        /// </summary>
        [fastCSharp.emit.webView.clearMember]
        private userItem[] logs;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="page"></param>
        /// <returns></returns>
        private bool loadView(int userId, int page)
        {
            if (base.loadView(userId))
            {
                diantou.dataAccess.item[] values = diantou.dataAccess.tcpCall.log.newFavorite(userId, pageInfo.Size = fastCSharp.config.pub.Default.PageSize, pageInfo.Page = page, currentUserId, currentUser != null && currentUser.IsChangeVisit, out pageInfo.Count);
                logs = values.getArray(value => new userItem { Item = value, User = currentUser });
                if (requestHeader.IsSearchEngine) pageInfo.Path = user.Path.NewFavorite.ToPageString();
                return true;
            }
            return false;
        }
    }
}
